package cn.javasea.websocket.handler.impl;

import cn.javasea.websocket.entity.JsonMessage;
import cn.javasea.websocket.handler.Action;
import cn.javasea.websocket.utils.WsBroadcastUtil;
import com.zhirui.oauth.sucket.handler.Handler;
import org.springframework.stereotype.Component;

import javax.websocket.Session;

/**
 * @author: Ethan_Fung
 * @description:
 * @date: 2020/4/13 22:36
 * @version: 1.0
 **/
@Component
public class HeartCheckHandler implements Handler {
    /**
     * 调用执行对应方法
     *
     * @param message
     * @param session
     * @return
     */
    @Override
    public Object action(String message, Session session) {
        WsBroadcastUtil.broadcastNotifications(session, new JsonMessage(Action.HEART_CHECK.name(), "心跳检测回复", null, "", "ok"));
        return null;
    }
}
